﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using CSharp4ExpressionMetaCompiler;
using SStuff.MetaEffects.Model;

namespace Sample2_CompositeShader.Providers
{
    public class InvertXProvider : ITexCoordModifierProvider
    {
        #region ITexCoordModifierProvider Members

        public Expression<Action<TexCoordOnlyParameters>> GetShaderExpression()
        {
            return o =>
                Block.Declare(new TexCoordOnlyParameters(), vars =>
                    Block.Default
                    .Assign(vars.TexCoord, new float2(1.0f - vars.TexCoord.x, vars.TexCoord.y))
                 );
        }

        #endregion
    }
}
